package com.ysf.buddy.service;

import com.ysf.buddy.model.domain.Team;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ysf.buddy.model.domain.User;
import com.ysf.buddy.model.dto.TeamQuery;
import com.ysf.buddy.model.request.TeamJoinRequest;
import com.ysf.buddy.model.request.TeamQuitRequest;
import com.ysf.buddy.model.request.TeamUpdateRequest;
import com.ysf.buddy.model.vo.TeamUserVO;

import java.sql.ResultSet;
import java.util.List;

/**
 * 创建队伍
* @author msi
* @description 针对表【team(队伍)】的数据库操作Service
* @createDate 2024-09-02 17:52:14
*/
public interface TeamService extends IService<Team> {

        /**
         * 创建队伍
         * @param team
         * @param loginUser
         * @return
         */
        long addTeam(Team team, User loginUser);

        /**
         * 搜索队伍
         * @param teamQuery
         * @return
         */
        List<TeamUserVO> listTeams(TeamQuery teamQuery, boolean isAdmin);

        /**
         * 更新队伍
         * @param teamUpdateRequest
         * @param loginUser
         * @return
         */
        boolean updateTeam(TeamUpdateRequest teamUpdateRequest,User loginUser);

        /**
         * 加入队伍
         * @param teamJoinRequest
         * @param loginUser
         * @return
         */
        boolean joinTeam(TeamJoinRequest teamJoinRequest, User loginUser);

        /**
         * 退出队伍
         * @param teamQuitRequest
         * @param loginUser
         * @return
         */
        boolean quitTeam(TeamQuitRequest teamQuitRequest, User loginUser);

        /**
         * 删除（解散）队伍
         * @param id
         * @return
         */
        boolean deleteTeam(long id,User loginUser);
}
